package ch07.proxy.extra.staticProxy;

/**
 * @description: 使用聚合的方法实现静态代理
 * @author: Fesine
 * @createTime:2016/9/8 18:57
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/9/8 18:57
 */
public class CarTimeProxy implements Moveable {

    private Moveable moveable;

    public CarTimeProxy(Moveable moveable) {
        super();
        this.moveable = moveable;
    }

    public void move() {
        long startTime = System.currentTimeMillis();
        System.out.println("汽车开始行驶...");
        moveable.move();
        long endTime = System.currentTimeMillis();
        System.out.println("汽车行驶结束...，行驶时间共" + (endTime - startTime) + "毫秒");
    }
}
